package edu.ccut.saturn.basecomponent.database.util;

import java.util.HashMap;

import edu.ccut.saturn.component.IParameterContext;

@SuppressWarnings("unchecked")
public class SaturnMap extends HashMap {

	private static final long serialVersionUID = 6767495983302065079L;
	
	private IParameterContext parameterContext = null;

	public SaturnMap(IParameterContext parameterContext) {
		this.parameterContext = parameterContext;
	}

	@Override
	public Object get(Object key) {
		
		if (this.containsKey(key)) {
			return super.get(key);
		}
		
		return parameterContext.getLogicContextValue((String) key);
	}
}
